﻿using System;
using System.Data;

namespace Shopping.Entities
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the UserOnlinesInfo
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class UserOnlinesInfo
    {
        #region Private Members

        private string _userName = "";
        private string _secretKey = "";
        private byte _groupId;
        private DateTime _lastestLogon;
        private int _orderId;
        private DateTime _createDate;
        private bool _allwayLogon;
        private string _ip = "";
        #endregion
        #region Constructors
        // initialization

        #endregion
        #region Public Properties
        /// <summary>
        /// Get and Set Property Data of File column UserName in Table UserOnlines 
        /// </summary>

        public string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column SecretKey in Table UserOnlines 
        /// </summary>

        public string SecretKey
        {
            get { return _secretKey; }
            set { _secretKey = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column GroupId in Table UserOnlines 
        /// </summary>

        public byte GroupId
        {
            get { return _groupId; }
            set { _groupId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column LastestLogon in Table UserOnlines 
        /// </summary>

        public DateTime LastestLogon
        {
            get { return _lastestLogon; }
            set { _lastestLogon = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column OrderId in Table UserOnlines 
        /// </summary>

        public int OrderId
        {
            get { return _orderId; }
            set { _orderId = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column CreateDate in Table UserOnlines 
        /// </summary>

        public DateTime CreateDate
        {
            get { return _createDate; }
            set { _createDate = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column AllwayLogon in Table UserOnlines 
        /// </summary>

        public bool AllwayLogon
        {
            get { return _allwayLogon; }
            set { _allwayLogon = value; }
        }

        /// <summary>
        /// Get and Set Property Data of File column Ip in Table UserOnlines 
        /// </summary>

        public string Ip
        {
            get { return _ip; }
            set { _ip = value; }
        }

        #endregion

        #region IHydratable Implementation

        /// <summary>
        /// 
        /// </summary>        
        public void Fill(IDataReader oReader)
        {
            _userName = Convert.ToString(oReader["UserName"]);
            _secretKey = Convert.ToString(oReader["SecretKey"]);
            _groupId = byte.Parse(oReader["GroupId"].ToString());
            _lastestLogon = DateTime.Parse(oReader["LastestLogon"].ToString());
            _orderId = int.Parse(oReader["OrderId"].ToString());
            _createDate = DateTime.Parse(oReader["CreateDate"].ToString());
            _allwayLogon = bool.Parse(oReader["AllwayLogon"].ToString());
            _ip = Convert.ToString(oReader["Ip"]);
        }
        #endregion
    }
}